const ResetScrollMixin = {
	methods: {
		resetUpScroll(immediately = false) {
			if(immediately && this.mescroll.optUp.use) {
				if(this.$refs.waterfall){
					this.$refs.waterfall.clear()
				}
				this.mescroll.resetUpScroll()
				return;
			}
			setTimeout(()=>{
				if(this.$refs.waterfall){
					if(Array.isArray(this.$refs.waterfall)){
						for(let item of this.$refs.waterfall){
							item.clear();
						}
					}else{
						this.$refs.waterfall.clear()
					}
				}
			},50)
			this.$u.debounce(() => {
				if (this.mescroll.optUp.use) {
					this.mescroll.resetUpScroll()
				} else {
					setTimeout(() => {
						this.mescroll.endSuccess();
					}, 500)
				}
			}, 300)
		},
		endErr(data){
			setTimeout(()=>{
				this.mescroll.endErr();
				if (this.mescroll.num == 1 && data) {
					this.mescroll.showEmpty();
				}
			},200)
		}
	}
}

export default ResetScrollMixin;
